package cn.com.cetccst.usercenter.ui;

import android.content.Intent;
import android.view.View;

import cn.com.cetccst.messagecenter.inboxmessage.InboxMessageActivity;
import cn.com.cetccst.uicomponents.binding.app.DataBindingConfig;
import cn.com.cetccst.uicomponents.binding.app.DataBindingFragment;
import cn.com.cetccst.usercenter.BR;
import cn.com.cetccst.usercenter.R;
import cn.com.cetccst.usercenter.UserInfoViewModel;
import cn.com.cetccst.usercenter.databinding.FragmentUserBinding;

public class UserFragment extends DataBindingFragment<FragmentUserBinding> {

    private UserInfoViewModel viewModel;

    @Override
    protected void initViewModel() {
        viewModel = getFragmentScopeViewModel(UserInfoViewModel.class);
    }

    @Override
    protected DataBindingConfig getDataBindingConfig() {
        return new DataBindingConfig(R.layout.fragment_user, BR.viewModel, viewModel);
    }

    //todo use ARouter
    public void enterMessage(View view) {
        Intent intent = new Intent(getContext(), InboxMessageActivity.class);
        startActivity(intent);
    }
}
